const LogColor:Record<LogType,number> = {
    "info":0xF5FFFA,
    "warn":0xffff00,
    "error":0xff0000,
}
export class Log
{
   
    private   Log(title:string,info:string){
        console.log(`[${title}\t:${Game.time}\t]:  [${info}]`);
    };
    Output(title:string,titlecolor:number,text:string,textcolor:number)
    {
        console.log(`<span style="color:#${titlecolor.toString(16)}">[${Game.time}\t:${title}\t]</span> <span style="color:#${textcolor.toString(16)}">[${text}] </span>`);
    }
    Text(title:string,text:string,type:LogType="info")
    {
       this.Output(title,0xffAAff,text,LogColor[type])
    }
    
    Warning(...info:string[])
    {
        this.Text("Game", info.join(`\t`),"warn");
       //global.LogDebug(`[Warning_${Game.time} :${info}`);
    }
    Info(...info:string[])
    {
         this.Text("Game",info.join(`\t`),"info");
    }
    Error(info:string)
    {
        this.Text("Game",info,"error");
        // global.LogDebug(`[Error]${info} ${JSON.stringify(new Error(info).stack)}`);
        // global.LogDebug(`[Error]${info} }`,true);
        // throw new Error(info);
    }
    Debug(key:string,...info:string[])
    {
        this.Text("debug",`[${Game.time}]${key}[${info.join(`\t`)}]`);
        Memory.Debug[key] = `[${Game.time}]:[${info.join(`\t`)}]`;
    }
}
